package cn.itlaobing.dao;

import cn.itlaobing.model.UserModel;
import org.apache.commons.dbutils.ResultSetHandler;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by xuaner on 2017/11/6.
 */
public class LoginDao implements ResultSetHandler<UserModel> {
    @Override
    public UserModel handle(ResultSet resultSet)throws SQLException{
        if(resultSet.next()){
            UserModel um=new UserModel();
            um.setUser_name(resultSet.getString("user_name"));
            um.setUser_pwd(resultSet.getString("user_pwd"));
            return um;
        }
        return  null;
    }
}
